<!-- 我的弹窗 -->

<template>
  <WebModal :title="one.name" noFooter>
    <MajorTitle :title="title" />

    <div class="row5 marginBottom">
      <PointChart :xData="param.xData" :dataList="one.dataList" />
    </div>
  </WebModal>
</template>

<script>
// ============================== 导入依赖 ============================== //

import CORE from '@/CORE'

// ============================== 导出组件 ============================== //

export default {
  /**
   * 名称定义 (实际使用名称)
   */
  name: 'MyModal',

  /**
   * 混入列表 (配置选项合并)
   */
  mixins: [CORE.mixWeb()],

  /**
   * 组件导入 (Abc.vue + Abc/index.vue)
   */
  ...CORE.components(require.context('./', true, /vue$/)),

  /**
   * 计算属性 (慎用箭头函数)
   */
  computed: {
    /**
     * 标题
     */
    title() {
      const { dateType: type, statisticTime: time } = this.param

      let timeStr = CORE.dateStr(time)
      if (type === 3) timeStr = timeStr.slice(0, 7)
      else if (type === 4) timeStr = timeStr.slice(0, 4)

      return `统计时间：${timeStr}`
    },
  },
}
</script>
